<ion-header>

  <ion-navbar>
    <ion-title>投资记录</ion-title>
  </ion-navbar>

  <ion-segment [(ngModel)]="type" class="g-border-bottom-1px">
    <ion-segment-button [value]="0">
      投资中
    </ion-segment-button>
    <ion-segment-button [value]="1">
      已结清
    </ion-segment-button>
  </ion-segment>

</ion-header>

<ion-content>
  <g-slides (didChange)="type = $event" [index]="type">
    <div class="slide1">
      <ion-content class="no-content">
        <g-default type="record" *ngIf="investList.length==0"></g-default>
        <div>
          <g-bill-item
            *ngFor="let invest of investList"
            [title]="invest.title"
            tipOne="投资金额"
            tipTwo="待收利息"
            [smallTitle]="invest.beginTime | date"
            [numOne]="invest.principal"
            [numTwo]="invest.interest | emptyToShow:'暂无'"></g-bill-item>
          <div class="g-no-more" *ngIf="last && investList.length>0">无更多数据</div>
          <ion-infinite-scroll (ionInfinite)="getMore($event)" class="g-infinite-scroll"
                               [enabled]="!last && investList.length>0">
            <ion-infinite-scroll-content loadingText="加载更多中..."></ion-infinite-scroll-content>
          </ion-infinite-scroll>
        </div>
      </ion-content>
    </div>
    <div class="slide2">
      <ion-content class="no-content">
        <g-default type="record" *ngIf="investFinishList.length==0"></g-default>
        <g-bill-item
          *ngFor="let invest of investFinishList"
          [title]="invest.title"
          tipOne="收回本金"
          tipTwo="入账利息"
          [smallTitle]="invest.beginTime | date"
          [numOne]="invest.principal"
          [numTwo]="invest.interest"></g-bill-item>
        <div class="g-no-more" *ngIf="lastFinish && investFinishList.length>0">无更多数据</div>
        <ion-infinite-scroll (ionInfinite)="getMoreFinish($event)" class="g-infinite-scroll"
                             [enabled]="!lastFinish && investFinishList.length>0">
          <ion-infinite-scroll-content loadingText="加载更多中..."></ion-infinite-scroll-content>
        </ion-infinite-scroll>
      </ion-content>
    </div>
  </g-slides>
</ion-content>

